# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.WorkloadManager.V1.Model.SapDiscoveryResource do
  @moduledoc """
  Message describing a resource.

  ## Attributes

  *   `instanceProperties` (*type:* `GoogleApi.WorkloadManager.V1.Model.SapDiscoveryResourceInstanceProperties.t`, *default:* `nil`) - Optional. A set of properties only applying to instance type resources.
  *   `relatedResources` (*type:* `list(String.t)`, *default:* `nil`) - Optional. A list of resource URIs related to this resource.
  *   `resourceKind` (*type:* `String.t`, *default:* `nil`) - Required. ComputeInstance, ComputeDisk, VPC, Bare Metal server, etc.
  *   `resourceType` (*type:* `String.t`, *default:* `nil`) - Required. The type of this resource.
  *   `resourceUri` (*type:* `String.t`, *default:* `nil`) - Required. URI of the resource, includes project, location, and name.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Required. Unix timestamp of when this resource last had its discovery data updated.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :instanceProperties =>
            GoogleApi.WorkloadManager.V1.Model.SapDiscoveryResourceInstanceProperties.t() | nil,
          :relatedResources => list(String.t()) | nil,
          :resourceKind => String.t() | nil,
          :resourceType => String.t() | nil,
          :resourceUri => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:instanceProperties,
    as: GoogleApi.WorkloadManager.V1.Model.SapDiscoveryResourceInstanceProperties
  )

  field(:relatedResources, type: :list)
  field(:resourceKind)
  field(:resourceType)
  field(:resourceUri)
  field(:updateTime, as: DateTime)
end

defimpl Poison.Decoder, for: GoogleApi.WorkloadManager.V1.Model.SapDiscoveryResource do
  def decode(value, options) do
    GoogleApi.WorkloadManager.V1.Model.SapDiscoveryResource.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.WorkloadManager.V1.Model.SapDiscoveryResource do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
